package ian.android.lovewords.ui;

import java.io.InputStream;
import ian.android.lovewords.R;
import ian.android.lovewords.settings.MyService;
import ian.android.lovewords.time.TimeManip;
import ian.android.lovewords.words.WordBlock;
import ian.android.lovewords.words.WordList;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;

public class ActivityHome extends BaseActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        stopService(new Intent(this, MyService.class));
        getActivityHelper().setupActionBar(null, 0);
        getActivityHelper().addActionButtonCompat(R.drawable.ic_title_search, R.string.description_search,
                new View.OnClickListener() {
					
					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						Log.i("Test","TEST!!!!!!!");
					}
				}, false);
        
        Button ibthome = (Button)findViewById(R.id.home_btn_map);
        ibthome.setOnClickListener( new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				startActivity( new Intent( ActivityHome.this , ReciteActivity.class) );
			}
		});
        
        Button ibtsche = (Button)findViewById(R.id.home_btn_schedule);
        ibtsche.setOnClickListener( new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				startActivity( new Intent( ActivityHome.this , ScheduleActivity.class) );
			}
		});
        
        Button ibtset = (Button)findViewById(R.id.home_btn_announcements);
        ibtset.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				startActivity(new Intent(ActivityHome.this,SettingActivity.class));
			}
		});
        
        /*InputStream in = getResources().openRawResource(R.raw.w1); 
        WordList wl = new WordList(1);
        wl.LoadListStream(in);
        
        TextView t = (TextView)findViewById(R.id.buttontext);
        t.setText(wl.getNextWordRecite().Word);
        Log.i("Happy",wl.getNextWordRecite().Word);
        Log.i("Happy",wl.getNextWordRecite().Word);
        Log.i("Happy",wl.getNextWordRecite().Word);*/
    }
}